package com.liveinstars.quhui.business.interest.service.impl;

import com.onepiece.shipelves.common.Result;
import com.onepiece.shipelves.common.enums.BaseExceptionEnum;
import lombok.Getter;

/**
 * @author: ting
 * @date: 2020/3/26
 */
@Getter
public enum QuhuiExceptionEnum implements BaseExceptionEnum {

    IS_EMPTY("20070000", "数据为空"),
    ENTITY_NOT_FOUND("20070001", "对象不存在"), POST_NOT_FOUND("20070002", "文章找不到");
    private String code;

    private String message;

    QuhuiExceptionEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }


    @Override
    public Result createResult() {
        Result result = new Result();
        result.setCode(this.code);
        result.setMessage(this.message);
        return result;
    }

    @Override
    public String getExceptionCode() {
        return this.getCode();
    }

    @Override
    public String getExceptionMessage() {
        return this.getMessage();
    }
}
